#! /usr/bin/env python
#coding=GBK
import t_player

inst = None
def init():
	global inst
	if not inst:
		inst = CEntityMgr()

def destroy():
	global inst
	if inst:
		inst.destroy()
		inst = None
def update():
	if inst:
		inst.update()
        
class CEntityMgr(object):
	def __init__(self):
		self.elist = []
		pass
	
	def destroy(self):
		pass
	
	def add_enty(self, einfo):
		entity = t_player.CPlayer(einfo)
		self.elist.append(entity)
		return entity
	
	def update(self):
		for enty in self.elist:
			enty.update()
		pass
